<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function load() {
		var p = document.getElementById("mp");
		//往元素内部添加html代码
		p.innerHTML = "<span><font color='red'>这是中国</font></span>";
		//往元素外部添加html代码
		//p.outerHTML = "<p>自我介绍</p>";
		
		var s = document.getElementById("ms");
		//往元素内部添加文本内容
		s.innerText = "javascript的世界很精彩";
	}
</script>
</head>
<body onload="load()">
	<p id="mp"></p>
	<span id="ms"></span>
</body>
</html>